#!/usr/bin/env python3
# coding=utf-8
# 作者：hnpyzzd
# 时间：2020-03-22
# 用途：打印斐波那契数列

#方法1
Fib_list = []
for i in range(100):
    n = i + 1
    if n < 3:
        Fib_list.append(1)
    else:
        s = Fib_list[i-1] + Fib_list[i-2]
        Fib_list.append(s)
print(Fib_list)

#方法2
Fib_dict = {}
for i in range(100):
    n = i + 1
    if n < 3:
        Fib_dict[n] = 1
    else:
        s = Fib_dict[n-1] + Fib_dict[n-2]
        Fib_dict[n] = s
for key,value in Fib_dict.items():
    print(value)
